<?php
/******************************
 * EQdkp
 * Copyright 2002-2003
 * Licensed under the GNU GPL.  See COPYING for full terms.
 * ------------------
 * manage_members.php
 * Began: Sun January 5 2003
 * 
 * $Id: manage_members.php 541 2008-05-20 06:56:16Z rspeicher $
 * 
 ******************************/

// Notice: Since 'Manage Members' function as a whole handles a lot of form and 
// processing code, this script will serve only as a framework for other processing
// scripts (found in the mm directory)
 
define('EQDKP_INC', true);
define('IN_ADMIN', true);
$eqdkp_root_path = './../';
include_once($eqdkp_root_path . 'common.php');

$fv = new Form_Validate;

// Start session management
$user->start();
$user->setup();
$user->check_auth('a_members_man');

$mode = ( isset($_REQUEST['mode']) ) ? $_REQUEST['mode'] : false;

// Figure out what submit button was pressed
$confirm = ( isset($_POST['confirm']) ) ? true : false;
$delete = ( isset($_POST['delete']) ) ? true : false;

//
// Processing
//
switch ( $mode )
{
    //
    // History Transfer
    //
    case 'transfer':
        include('mm/mm_transfer.php');
        break;
    //
    // Add a new member (also process edit member / delete member(s)
    //
    case 'addmember':
        include('mm/mm_addmember.php');
        break;
    //
    // List Members
    //
    case 'list':
        include('mm/mm_listmembers.php');
        break;
    //
    // We dunno, display menu
    //
    default:
        $tpl->assign_vars(array(
            'L_MANAGE_MEMBERS' => $user->lang['manage_members'],
            'L_ADD_MEMBER' => $user->lang['add_member'],
            'L_LIST_EDIT_DEL_MEMBERS' => $user->lang['list_edit_del_member'],
            'L_TRANSFER_HISTORY' => $user->lang['transfer_history'],
            
            'U_ADD_MEMBER' => 'manage_members.php' . $SID . '&amp;mode=addmember',
            'U_LIST_MEMBERS' => 'manage_members.php' . $SID . '&amp;mode=list',
            'U_TRANSFER_HISTORY' => 'manage_members.php' . $SID . '&amp;mode=transfer')
        );
        
        $page_title = sprintf($user->lang['admin_title_prefix'], $eqdkp->config['guildtag'], $eqdkp->config['dkp_name']).': '.$user->lang['manage_members_title'];
        include_once($eqdkp_root_path . 'includes/page_header.php');
        
        $tpl->set_filenames(array(
            'body' => 'admin/mm_menu.html')
        );
        
        include_once($eqdkp_root_path . 'includes/page_tail.php');
        
        break;
}
?>